#!/usr/bin/python3

from tkinter import *

class Application(Frame):#继承Frame类
    """Build the basic window frame template"""

    def __init__(self, master):#定义构造函数
        super(Application,self).__init__(master)#父类构造函数
        self.grid()#打开控件的网格定位

root = Tk()#实例化
root.title('Test Application window')#窗口标题
root.geometry('300x100')#窗口大小
app = Application(root)#窗口初始化
app.mainloop()#事件驱动监听
